There are conventional video game devices and video game programs for displaying objects in a virtual space on the screen. For example, there is a video game in which there are objects (characters) in a three-dimensional virtual game space, wherein the display area is determined so that primary objects will be shown within the screen (see, for example, “Nintendo Official Player's Guide—Dairanto Smash Brothers DX (Super Smash Brothers Melee)”, Shogakukan Inc., Jan. 20, 2002, p4 (Non-Patent Document 1)). This is a fighting video game in which there are a plurality of characters, one of which is controlled by the player. The video game device automatically adjusts the position and the direction of a virtual camera so that the characters are shown within the screen. An image of the game space taken by the virtual camera is displayed on the screen. Thus, the player can enjoy the game without losing sight of the player character or the opponent character.
Depending on the nature of the video game, simply keeping all the primary objects within the screen may not always give the best view for the player. For example, in video games where the player character shoots an arrow or a gun in a certain direction in the game space, more of the area in that direction is preferably displayed on the screen. Specifically, in a case where the player character is to shoot an arrow in the upper right direction of the screen, the player character is preferably displayed closer to the lower left corner of the screen so that more of the area in the upper right direction from the player character is displayed on the screen. This does not apply only to those cases where the player controls the player character. In any case where the player performs an operation in a certain direction with reference to a point in the game space, it is preferable for the player that more of the area in that direction is displayed on the screen.
With the method of Non-Patent Document 1, however, the display area is determined based on a plurality of objects in the game space. Therefore, if there are no primary objects in a particular area in the game space, the displayed game space will not be centered about the particular area even if the player wishes to see the particular area. Thus, it is not possible with this method to display the game space on the screen in a preferred manner for the player in such a case where the player character shoots an arrow, for example.
Therefore, a feature of certain exemplary embodiments is to provide an image processing program and an image processing device in which the user is allowed to freely adjust the display area of a virtual space.
Certain exemplary embodiments have the following aspects to attain the feature mentioned above. Note that parenthetic expressions in the following section (reference numerals, supplementary explanations, etc.) are merely to indicate the correlation between what is described in the following section and what is described in the detailed description set out further below in the present specification, and are in no way intended to restrict the scope of the exemplary embodiments described herein.
A first aspect of certain exemplary embodiments is directed to a computer-readable storage medium storing an image processing program (video game program) to be executed by a computer (the CPU core 21, etc.) of an image processing device (the video game device 10) for displaying an image of a three-dimensional virtual space (game space) including an image of a controlled object (the player character 41) placed in the virtual space, which can be controlled by the user, by using a virtual camera whose position is determined based on a point of sight set in the virtual space. The image processing device includes an input device (the touch panel 15) for outputting an input position corresponding to a point on a screen of a display device (the second LCD 12) specified by the user. The image processing program instructs the computer to perform a position obtaining step (S13), a first calculation step (S15), a second calculation step (S19 and S20), a movement control step (S24) and a display control step (S6). In the position obtaining step, the computer obtains an input position (the point P3 shown in FIG. 9) outputted from the input device. In the first calculation step, the computer calculates a difference vector (the vector V1 shown in FIG. 9) extending from a predetermined reference position (the point P2 shown in FIG. 9) on the screen to the input position. In the second calculation step, the computer calculates movement parameter data (58) used for moving, with respect to a fixed point in the virtual space (the point p1 shown in FIG. 13) uniquely determined based on a position of the controlled object, the point of sight to a position that is determined by a direction in the virtual space based on a direction of the difference vector and a distance in the virtual space based on a magnitude of the difference vector (see FIG. 13). In the movement control step, the computer moves the point of sight based on the movement parameter data. In the display control step, the computer produces an image based on the virtual camera, which has been moved according to the movement of the point of sight, and displaying the image on the screen of display device.
According to a second aspect, in the second calculation step, position data representing a target point (the point p2 shown in FIG. 13) in the virtual space is calculated as the movement parameter data. The target point is determined, with respect to the fixed point, by a direction in the virtual space based on the direction of the difference vector and a distance in the virtual space based on the magnitude of the difference vector. In the movement control step, the point of sight is moved to the target point.
According to a third aspect, in the movement control step, the point of sight is moved so that the point of sight gradually approaches the target point.
According to a fourth aspect, in the second calculation step, the movement parameter data is calculated so that the controlled object will not be outside the screen after the point of sight is moved.
According to a fifth aspect, the image processing program instructs the computer to further perform a detection step (S12) of detecting whether there is no longer an input to the input device. In the second calculation step, the movement parameter data used for moving the point of sight to the fixed point is calculated when it is detected in the detection step that there is no longer an input.
A sixth aspect of certain exemplary embodiments is directed to a computer-readable storage medium storing an image processing program (video game program) to be executed by a computer (the CPU core 21, etc.) of an image processing device (the video game device 10) for displaying an image of a three-dimensional virtual space (game space) including an image of a controlled object (the player character 41) placed in the virtual space, which can be controlled by the user, by using a virtual camera whose position is determined based on a point of sight set in the virtual space. The image processing device includes an input device (the touch panel 15) for outputting an input position corresponding to a point on a screen of a display device (the second LCD 12) specified by the user. The image processing program instructs the computer to perform a position obtaining step (S13), a first calculation step (S15), a second calculation step (S19 and S20), a movement control step (S24) and a display control step (S6). In the position obtaining step, the computer obtains an input position (the point P3 shown in FIG. 9) outputted from the input device. In the first calculation step, the computer calculates a difference vector (the vector V1 shown in FIG. 9) extending from a predetermined reference position (the point P2 shown in FIG. 9) on the screen to the input position. In the second calculation step, the computer calculates movement parameter data (58) used for moving, with respect to a fixed point in the virtual space (the point p1 shown in FIG. 13) uniquely determined based on a position of the controlled object, the display area to a position that is determined by a direction in the virtual space based on a direction of the difference vector and a distance in the virtual space based on a magnitude of the difference vector. In the movement control step, the computer moves the display area based on the movement parameter data. In the display control step, the computer displays, on the display device, an image of the virtual space within the display area.
According to a seventh aspect, in the second calculation step, the movement parameter data is calculated as being position data representing a target point in the virtual space (the point p2 shown in FIG. 13) that is determined, with respect to the fixed point, by a direction in the virtual space based on the direction of the difference vector and a distance in the virtual space based on the magnitude of the difference vector. In the movement control step, the display area is moved so that a predetermined point in the display area coincides with the target point.
According to an eighth aspect, in the movement control step, the display area is moved so that the predetermined point in the display area gradually approaches the target point.
According to a ninth aspect, in the second calculation step, the movement parameter data is calculated so that the controlled object will not be outside the screen after the display area is moved to the target point.
According to a tenth aspect, the image processing program instructs the computer to further perform a detection step (S12) of detecting whether there is no longer an input to the input device. In the second calculation step, the movement parameter data used for moving the display area so that the fixed point is displayed at the reference position is calculated when it is detected in the detection step that there is no longer an input.
According to an eleventh aspect, the second calculation step includes a space vector calculation step (S19) and a target point setting step (S20). In the space vector calculation step, the computer calculates a space vector (the vector v1 shown in FIG. 13), being a vector in the virtual space, based on the difference vector. In the target point setting step, the computer sets the target point at a position of an end point of the space vector with respect to the fixed point. The space vector calculation step further includes a first correction step (S16 and S17) of correcting at least one of the difference vector and the space vector so that a magnitude of the space vector is less than or equal to a predetermined upper limit value.
According to a twelfth aspect, the second calculation step includes a space vector calculation step (S19) and a target point setting step (S20). In the space vector calculation step, the computer calculates a space vector, being a vector in the virtual space, based on the difference vector. In the target point setting step, the computer sets the target point at a position of an end point of the space vector with respect to the fixed point. In the space vector calculation step, a component of the space vector with respect to a first direction in the virtual space (the z-axis direction shown in FIG. 13) is calculated based on a component of the difference vector with respect to a third direction on the screen (the Y-axis direction shown in FIG. 13), and a component of the space vector with respect to a second direction perpendicular to the first direction (the x-axis direction shown in FIG. 13) is calculated based on a component of the difference vector with respect to a fourth direction perpendicular to the third direction (the X-axis direction shown in FIG. 13).
According to a thirteenth aspect, the virtual space has a predetermined plane (the ground 43) on which the controlled object can be moved. The virtual camera has a viewing direction being perpendicular to the second direction and with an angle of depression of less than 90° with respect to the predetermined plane. The third direction is parallel to a direction of a straight line displayed on the screen extending in the first direction through the point of sight. The space vector calculation step includes a second correction step of correcting at least one of the difference vector and the space vector so that a proportion of the component of the space vector in the second direction with respect to the component of the space vector in the first direction is greater than a proportion of the component of the difference vector in the fourth direction with respect to the component of the difference vector in the third direction.
The certain exemplary embodiments described herein may be carried out in the form of an image processing device having substantially the same function as that realized by executing an image processing program as set forth above.
According to the first or sixth aspect, the display area is moved according to the input position specified by the player. Thus, the player is allowed to move the display area by using a pointing device capable of detecting an input position on the screen. The difference vector used for determining the amount by which the display area is to be moved is calculated based on the reference position and the input position on the screen, whereby the magnitude thereof is limited. Therefore, the area across which the display area is moved can be limited to a predetermined area centered about the fixed point, whereby the display area will not be at a position far away from the fixed point. For example, if the fixed point is set at or near the position of the controlled object, the player can move the display area across an area centered about the controlled object.
According to the second or seventh aspect, by setting the target point, it is possible to easily move the display area according to the input position specified by the player, irrespective of the current position of the display area.
According to the third or eighth aspect, it is possible to prevent the abrupt movement of the display area, which may be difficult for the player to follow. The abrupt movement of the display area may seem to the player to be a switching of a virtual space image from one to another, which may be difficult for the player to follow. In contrast, according to the third or seventh aspect, the display area is moved gradually, whereby it is possible to display the game image in a preferred manner for the player without causing the player to feel like the game image is switched from one to another.
According to the fourth or ninth aspect, it is possible to keep the controlled object always displayed within the screen.
According to the fifth or tenth aspect, the player can easily bring the display back to the state where the fixed point is displayed at the reference position by discontinuing the input to the input device. Therefore, it is possible to improve the playability in moving the display area.
According to the eleventh aspect, the magnitude of the space vector used for setting the target point is limited to a value less than or equal to the upper limit value. Thus, if the upper limit value is set to an appropriate value, it is possible to keep the controlled object always displayed within the screen.
According to the twelfth aspect, the space vector can be calculated by a simple method based on the difference vector. This eliminates the need for a complicated calculation, such as the conversion from the two-dimensional screen coordinate system to the three-dimensional virtual space coordinate system, whereby it is possible to calculate the position of the target point with a small amount of calculation.
According to the thirteenth aspect, the virtual camera is set with an angle of depression of less than 90° with respect to the predetermined plane. If the proportion between the component of the space vector in the third direction and the component thereof in the fourth direction is the same as the proportion between the component of the difference vector in the first direction and the component thereof in the second direction, the player may feel awkward when the display area is moved. Specifically, the player may feel that the amount by which the display area is moved in the first direction of the screen is too small. In contrast, according to the eleventh aspect, it is possible to reduce such awkwardness that may be felt by the player by correcting the direction of the difference vector or the space vector.
These and other features, aspects and advantages of certain exemplary embodiments will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.